/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package contatos.patterns.strategy;

import contatos.patterns.strategy.apoio.ComparadorDeTelefoneContato;
import java.util.ArrayList;
import java.util.Collections;

/**
 *
 * @author felipe
 */
public class OrdenarPorTelefone implements IOrdernarStrategy {

    @Override
    public void ordenar(ArrayList lista, boolean crescente) {
        Collections.sort(lista, new ComparadorDeTelefoneContato());
        if(!crescente)
            Collections.reverse(lista);
            
    }

}
